<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 封装数组push函数
      var arr1 = [4, 5, 6];
      function fn(arr, val) {
       
          arr[arr.length] = val;
      }
     fn(arr1, 9);
     console.log(arr1)
    </script>
  </body>
</html>
